const path = require('path');

const resolve = dir => path.join(__dirname, dir);
module.exports = {
	lintOnSave: false,
	publicPath: '/',
	chainWebpack: config => {
		config.resolve.alias
			.set('@', resolve('src'))
			.set('_c', resolve('src/components'))
	},
	// 打包时不生成.map文件
	productionSourceMap: false,
	devServer: {
		open: true,
		port: 8080,
		proxy: {
			'/api': {
				target: 'http://localhost:3000/',
				changeOrigin: true,
				ws: true,
				pathRewrite: {
                    '^/api': ''
                }
			}
		},
		before: app => {}
	}
}
